package com.iad.model
{
  import com.adobe.cairngorm.model.ModelLocator;
  import com.iad.model.valueobject.*;
  import com.iad.view.component.*;
  import com.iad.view.form.*;
  import com.iad.view.helper.*;
  
  import mx.collections.ArrayCollection;
  import mx.controls.Image;
  
  [Bindable]
  public class ModelLocatorImpl implements com.adobe.cairngorm.model.ModelLocator
  {
    private static var _modelLocator:ModelLocatorImpl;
    
    public const DEFAULT_BROWSER_TITLE:String = "Independent Artists Direct";
    public const DEFAULT_ISSUE_DATE_TITLE:String = "April 2009";
    
    public const PROPERTIES_SERVICE:String = "propertiesService";
    
    public const PLAYING:int = 1;
    public const STOPPED:int = 2;
    public const PAUSED:int = 3;
    public const SEEKING:int = 4;
    public const REWINDING:int = 5;
    public const FASTFORWARDING:int = 6;
    
    public const ADMIN_ID:int = -1;
    
    public const MIN_COVERFLOW_SIZE:int = 12;
    public var coverFlowSize:int;
    
    public const BIO_PAGE:String = "bio";
    public const INFO_PAGE:String = "latest";
    public const SUBSECTION_TITLE:String = "subSectionTitle";
    public const IMAGE_GROUP:String = "imageGroup";
    public const IMAGE:String = "image";
    public const PARAGRAPH:String = "paragraph";
    public const EDIT_CONTROL_FORMAT:String = "editControlFormat";
    public const NEW_SITE_CONTROL_FORMAT:String = "newSiteControlFormat";
    public const NEW_SONG_CONTROL_FORMAT:String = "newSongControlFormat";
    public const NEW_PLAYLIST_CONTROL_FORMAT:String = "newPlaylistControlFormat";
    public const NEW_VIDEO_CONTROL_FORMAT:String = "newVideoControlFormat";
    
    public const EXISTING_SUBSECTION_TITLE:String = "existingSubSectionTitle";
    public const EXISTING_PARAGRAPH:String = "existingParagraph";
    public const EXISTING_IMAGE:String = "existingImage";
    public const EXISTING_IMAGE_GROUP:String = "existingImageGroup";
    public const NEW_SUBSECTION_TITLE:String = "newSubSectionTitle";
    public const NEW_PARAGRAPH:String = "newParagraph";
    public const NEW_IMAGE:String = "newImage";
    public const NEW_SITE:String = "newSite";
    public const NEW_SONG:String = "newSong";
    public const NEW_PLAYLIST:String = "newPlaylist";
    public const NEW_VIDEO:String = "newVideo";
    
    public const ARTIST_VIEW:String = "ArtistView";
    public const MAIN_VIEW:String = "MainView";
    public const MINIMIZED:String = "Minimized";
    public const MAXIMIZED:String = "Maximized";
    public const HIDDEN:String = "Hidden";
    
    public var user:Site; 
    
    public var songsArray:ArrayCollection = new ArrayCollection();
    public var playlists:ArrayCollection = new ArrayCollection();
    public var sites:ArrayCollection = new ArrayCollection();
    public var videos:ArrayCollection = new ArrayCollection();
    public var discographyItems:ArrayCollection = new ArrayCollection();
    public var currentSong:Song;
    public var currentSongPlaying:Song;
    public var currentSongPlayingTitle:String;
    public var sitePath:String = "site/sites/";
    public var signupSiteImagePath:String = "assets/images/nick_explorer_icon.jpg";
    public var signupPlaylistImageName:String;
    public var signupPlaylistImagePath:String = "assets/images/new_coverflow_item.jpg";
    public var signupSiteImageName:String;
    public var signupWizard:SignupWizard;
    public var currentSiteLabel:String;
    public var currentPlaylistSiteName:String;
    public var currentPlaylistSiteId:int;
    public var approveReviewsMode:Boolean;
    public var signupWizardActive:Boolean;
    public var SERVER:String;
    public var PORT:String;
    public var PORT_FORMATTED:String;
    public var CONTEXT:String;
    public var playerLaunched:Boolean;
    public var playerMaximizedByDefault:Boolean;
    public var progressMessage:String;
    public var progressBarVisible:Boolean;
    public var reviewPageVisible:Boolean;
    public var currentPlayerState:int = STOPPED;
    
    public var latestUpload:Image = new Image();
    
    public var currentVideoId:int;
    public var currentPlaylistId:int;
    public var currentSiteId:int;
    public var playlistSiteId:int;
    public var currentSite:Site;
    
    public var mainPages:ArrayCollection = new ArrayCollection();
    public var sitePages:ArrayCollection = new ArrayCollection();
    
    public var app:Main;
    
    public var EDIT_MODE:Boolean;
    public var NEW_SITE_MODE:Boolean;
    
    [Embed("/assets/images/linkCursor.png")]
    public var linkCursor:Class;
    
    [Embed("/assets/images/move_cursor.png")]
    private var moveCursor:Class;
    
    
    public static function getInstance():ModelLocatorImpl {
      if (_modelLocator == null)
        _modelLocator = new ModelLocatorImpl();
      
      return _modelLocator;
    }
    
    public function ModelLocatorImpl()
    {
      if ( _modelLocator != null ) {
        throw new Error( "Only one ModelLocator instance should be instantiated" );
     }
    }

           
  }
}
